﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace V32Assembler
{
    public class Error : Exception
    {
        public int LineNumber { get; private set; }

        public Error(string message)
            : this(Assembler.CurrentLineNumber, message) { }

        public Error(int line, string message)
            : base(message)
        {
            LineNumber = line;
            Assembler.Errors.Add(this);
        }
    }
    //public class FatalError : Error
    //{
    //    public FatalError(string message)
    //        : this(Assembler.CurrentLineNumber, message) { }

    //    public FatalError(int line, string message)
    //        : base(line, message)
    //    {
    //        Assembler.Errors.Add(this);
    //    }

    //    public FatalError(Error error)
    //        : this(error.LineNumber, error.Message) { }
    //}
    public class Warning
    {
        public string Message { get; private set; }
        public int LineNumber { get; private set; }

        public Warning(string message) : this(Assembler.CurrentLineNumber, message) { }

        public Warning(int line, string message)
        {
            Message = message;
            LineNumber = line;
            Assembler.Warnings.Add(this);
        }
    }
}
